import { LOGOUT } from '@/store/actionTypes'
import { removeToken } from '@/utils/storage'
// eslint-disable-next-line no-undef
export const logout = () => {
  return (dispatch) => {
    // 清除本地token
    removeToken()
    // 清空redux中的token
    dispatch({
      type: LOGOUT
    })
  }
}